home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / IEditor / ARexx / ImgBox.ie < prev    next >
Encoding:
Text File  |  1997-06-17  |  1.8 KB  |  84 lines

  1. /*
  2. ** $VER: ImgBox.ie 1.002 (29.04.96) © Simone Tellini
  3. **
  4. **
  5. **  FUNCTION:
  6. **      Add a Bevel Box around an image
  7. **
  8. ** $HISTORY:
  9. **
  10. ** 29 Apr 1996 : 001.002 : Now it uses rexxreqtools.library, if possible
  11. ** 25 Apr 1996 : 001.001 : The user can select the bevel type so it will be
  12. **                          rendered better! by Gian Maria Calzolari
  13. ** ?? ??? 1995 : 001.000 : First version
  14. **
  15. */
  16.  
  17. OPTIONS RESULTS
  18.  
  19. SIGNAL ON ERROR
  20.  
  21. ADDRESS 'IEDITOR.1'
  22.  
  23. call addlib("rexxreqtools.library", 0, -30, 0)
  24.  
  25. UseLib = 0
  26.  
  27. if show( L, "rexxreqtools.library" ) then UseLib = 1
  28.  
  29. 'GETIMAGE'
  30. if RC = 5 then exit  /* user aborted */
  31.  
  32. 'GETIMAGEATTR' result img
  33.  
  34. if UseLib then do
  35.  
  36.     call rtezrequest( 'Choose the Bevel Type:', '_Button|_Ridge|Icon _DropBox',, 'rt_pubscrname = "IEditor.1" rt_reqpos = reqpos_centerscr' )
  37.  
  38.     BoxType = rtresult
  39.  
  40.     if BoxType == 0 then BoxType = 3
  41.  
  42. end
  43. else do
  44.     /* close standard I/O channels (if IE started from CLI, this lets
  45.        the output to be redirected where I want) */
  46.  
  47.     call close 'STDOUT'
  48.     call close 'STDIN'
  49.  
  50.     /* open a window for dos I/O on IEditor's screen */
  51.  
  52.     call open 'STDOUT','CON:100/10/510/200/Add a Bevel Box around an image/SCREEN IEDITOR.1'
  53.     call pragma '*','STDOUT'
  54.     call open 'STDIN','*'
  55.  
  56.     /* ask the type */
  57.  
  58.     say 'Bevel type (1=Button, 2=Ridge, 3=iconDropBox)'
  59.     parse pull BoxType
  60.  
  61.     /* close the window */
  62.  
  63.     call close 'STDIN'
  64.     call close 'STDOUT'
  65. end
  66.  
  67. select
  68.     when BoxType = 1 then
  69.          'ADDBOX' img.leftedge-2 img.topedge-1 img.width+4 img.height+2 BoxType
  70.     when BoxType = 2 then
  71.          'ADDBOX' img.leftedge-4 img.topedge-2 img.width+8 img.height+4 BoxType
  72.     when BoxType = 3 then
  73.          'ADDBOX' img.leftedge-6 img.topedge-3 img.width+12 img.height+6 BoxType
  74. end
  75.  
  76. EXIT
  77.  
  78.  
  79. ERROR:
  80.  
  81. say 'Error "'|| RC ||'"on line' SIGL
  82.  
  83. EXIT RC
  84.